import { fetch, fetchCPT } from './fetch.js'

// // 登录
// const login = params => {
//   return fetchCPT({
//     url: '/Loginyz',
//     method: 'post',
//     params: params
//   })
// }
// // 验证码
// const getCpt = params => {
//   return fetchCPT({
//     url: '/Getcpt',
//     method: 'get',
//     data: params
//   })
// }
// const orderList = params => {
//   return fetch({
//     url: `/api/data/${params.category}/${params.limit}/${params.page}`,
//     method: 'get',
//     params: ''
//   })
// }


const apiList = {
  // 登录
  login: function (params) {
    return fetchCPT({
      url: '/Loginyz',
      method: 'post',
      params: params
    })
  },
  // 验证码
  getCpt: function (params) {
    return fetchCPT({
      url: '/Getcpt',
      method: 'get',
      data: params
    })
  },
  // 退出
  logout: function (params) {
    return fetch({
      url: '/auth/LogoutAPI',
      method: 'get',
      params: params
    })
  },
  //获取用户数据
  getMe: function (params) {
    return fetch({
      url: '/user/Getme',
      method: 'get',
      params: params
    })
  },
  //获取资源
  getResource: function (params) {
    return fetch({
      url: '/resource/',
      method: 'get',
      params: params
    })
  },
  // 更新资源
  updateResource: function (data) {
    return fetch({
      url: '/resource/Update',
      method: 'post',
      params: data
    })
  },
  // 添加资源
  addResource: function (data) {
    return fetch({
      url: '/resource/',
      method: 'post',
      params: data
    })
  },
  // 删除资源
  deleteResource: function (data) {
    return fetch({
      url: '/resource/Delete',
      method: 'post',
      params: data
    })
  },
  // 获取用户列表
  getUser: function (data) {
    return fetch({
      url: '/user/',
      method: 'get',
      params: data
    })
  },
  // 获取单位用户列表
  GetAllOrgUsers: function (data) {
    return fetch({
      url: '/user/GerUserByOrg',
      method: 'get',
      params: data
    })
  },
  // 根据角色获取单位用户
  GetUsersByRole: function (data) {
    return fetch({
      url: '/user/GetAllOrgUsers',
      method: 'get',
      params: data
    })
  },
  //更新用户
  updateUser: function (data) {
    return fetch({
      url: '/user/Update',
      method: 'post',
      params: data
    })
  },
  //添加用户
  addUser: function (data) {
    return fetch({
      url: '/user/',
      method: 'post',
      params: data
    })
  },
  // 删除用户
  deleteUser: function (data) {
    return fetch({
      url: '/user/Delete',
      method: 'post',
      params: data
    })
  },
  // 删除用户列表
  deleteUsers: function (data) {
    return fetch({
      url: '/user/DeleteUsers',
      method: 'post',
      params: data
    })
  },

  // 更新密码
  ChangePwd: function (data) {
    return fetch({
      url: '/user/ChangePwd',
      method: 'post',
      params: data
    })
  },
  // 重置密码
  ResetPwd: function (data) {
    return fetch({
      url: '/user/ResetPwd',
      method: 'post',
      params: data
    })
  },
  // 更新用户属性
  UpdateUserProf: function (data) {
    return fetch({
      url: '/user/UpdateUserProf',
      method: 'post',
      params: data
    })
  },
  // 照片取消
  PhotoCancel: function (data) {
    return fetch({
      url: '/user/PhotoCancel',
      method: 'post',
      params: data
    })
  },
  //获取客户单位
  getOrganization: function (data) {
    return fetch({
      url: '/organization/',
      method: 'get',
      params: data
    })
  },
  // 获取客户单位列表
  getOrganizationList: function (data) {
    return fetch({
      url: '/organization/GetOrganizationList',
      method: 'get',
      params: data
    })
  },
  // 更新客户单位
  updateOrganization: function (data) {
    return fetch({
      url: '/organization/Update',
      method: 'post',
      params: data
    })
  },
  // 添加客户单位
  addOrganization: function (data) {
    return fetch({
      url: '/organization/',
      method: 'post',
      params: data
    })
  },
  // 删除客户单位列表
  deleteOrganization: function (data) {
    return fetch({
      url: '/organization/Delete',
      method: 'post',
      params: data
    })
  },
  //获取角色
  getRole: function (data) {
    return fetch({
      url: '/role/',
      method: 'get',
      params: data
    })
  },
  // 获取角色列表
  getRoleList: function (data) {
    return fetch({
      url: '/role/GetRoleList',
      method: 'get',
      params: data
    })
  },
  // 获取组织角色列表
  GetOrgRoleList: function (data) {
    return fetch({
      url: '/role/GetOrgRoleList',
      method: 'get',
      params: data
    })
  },
  // 更新角色
  updateRole: function (data) {
    return fetch({
      url: '/role/Update',
      method: 'post',
      params: data
    })
  },
  // 添加角色
  addRole: function (data) {
    return fetch({
      url: '/role/',
      method: 'post',
      params: data
    })
  },
  // 删除角色
  deleteRole: function (data) {
    return fetch({
      url: '/role/Delete',
      method: 'post',
      params: data
    })
  },
  // 删除多个角色
  deleteRoles: function (data) {
    return fetch({
      url: '/role/DeleteRoles',
      method: 'post',
      params: data
    })
  },
  // 获取角色资源树
  GetRoleResourceTree: function (data) {
    return fetch({
      url: '/role/GetRoleResourceTree/' + data,
      method: 'get',
      params: data
    })
  },
  // 角色分配资源
  AssignResources: function (data) {
    return fetch({
      url: '/role/AssignResources',
      method: 'post',
      params: data
    })
  },
  // 获取部门
  GetDept: function (data) {
    return fetch({
      url: '/dept/',
      method: 'get',
      params: data
    })
  },
  // 更新部门
  UpdateDept: function (data) {
    return fetch({
      url: '/dept/Update',
      method: 'post',
      params: data
    })
  },
  // 添加部门
  AddDept: function (data) {
    return fetch({
      url: '/dept/',
      method: 'post',
      params: data
    })
  },
  // 删除部门
  DeleteDept: function (data) {
    return fetch({
      url: '/dept/Delete',
      method: 'post',
      params: data
    })
  },
  // 删除部门列表
  DeleteDepts: function (data) {
    return fetch({
      url: '/dept/DeleteDepts',
      method: 'post',
      params: data
    })
  },
  // 用户分配部门
  AssignUserDept: function (data) {
    return fetch({
      url: '/dept/AssignUserDept',
      method: 'post',
      params: data
    })
  },
  //获取工作流
  getFlow: function (data) {
    return fetch({
      url: '/flow/',
      method: 'get',
      params: data
    })
  },
  // 获取单个工作流
  getFlowOne: function (data) {
    return fetch({
      url: `/flow/`+data,
      method: 'get',
      params: data
    })
  },
    // 获取工作流实例
  getFlowInst: function (data) {
    return fetch({
      url: `/flowinstance/`+data,
      method: 'get',
      params: data
    })
  },
  // 添加工作流
  AddFlow: function (data) {
    return fetch({
      url: '/flow/',
      method: 'post',
      params: data
    })
  },
  // 删除工作流
  deleteFlow: function (data) {
    return fetch({
      url: '/flow/Delete',
      method: 'post',
      params: data
    })
  },
  // 更新工作流
  UpdateFlow: function (data) {
    return fetch({
      url: '/flow/Update',
      method: 'post',
      params: data
    })
  },
  //获取动作
  getAction: function (data) {
    return fetch({
      url: '/action/GetAll',
      method: 'get',
      params: data
    })
  },
  // 删除动作
  deleteAction: function (data) {
    return fetch({
      url: '/action/Delete',
      method: 'post',
      params: data
    })
  },
  //获取工作流-事件
  getEvent: function (data) {
    return fetch({
      url: '/event/GetAll',
      method: 'get',
      params: data
    })
  },
  // 删除工作流事件
  deleteEvent: function (data) {
    return fetch({
      url: '/event/Delete',
      method: 'post',
      params: data
    })
  },
  //获取日志
  getLog: function (data) {
    return fetch({
      url: '/log/GetAll',
      method: 'post',
      params: data
    })
  },
  // 删除日志
  deleteLogs: function (data) {
    return fetch({
      url: '/log/DeleteLogs',
      method: 'post',
      params: data
    })
  },
  // 获取公告列表
  getBulletin: function (data) {
    return fetch({
      url: '/bulletin/GetAll',
      method: 'post',
      params: data
    })
  },
  // 获取有效公告
  getMyBulletin: function (data) {
    return fetch({
      url: '/bulletin/GetVaildateBulletins',
      method: 'get',
      params: data
    })
  },
  // 更新公告
  updateBulletin: function (data) {
    return fetch({
      url: '/bulletin/Update',
      method: 'post',
      params: data
    })
  },
  // 添加公告
  addBulletin: function (data) {
    return fetch({
      url: '/bulletin/',
      method: 'post',
      params: data
    })
  },
  // 删除公告
  deleteBulletin: function (data) {
    return fetch({
      url: '/bulletin/Delete',
      method: 'post',
      params: data
    })
  },
  // 删除公告列表
  deleteBulletins: function (data) {
    return fetch({
      url: '/bulletin/DeleteBulletins',
      method: 'post',
      params: data
    })
  },
  // 获取直播频道
  getLiveChannel: function (data) {
    return fetch({
      url: '/livechannel/GetAll',
      method: 'post',
      params: data
    })
  },
  // 更新直播频道
  updateLiveChannel: function (data) {
    return fetch({
      url: '/livechannel/Update',
      method: 'post',
      params: data
    })
  },
  // 添加直播频道
  addLiveChannel: function (data) {
    return fetch({
      url: '/livechannel/',
      method: 'post',
      params: data
    })
  },
  // 删除直播频道
  deleteLiveChannel: function (data) {
    return fetch({
      url: '/livechannel/Delete',
      method: 'post',
      params: data
    })
  },
  // 删除直播频道列表
  deleteLiveChannels: function (data) {
    return fetch({
      url: '/livechannel/DeleteLiveChannels',
      method: 'post',
      params: data
    })
    // return post('/livechannel/DeleteLiveChannels', data, )
  },
  // 获取直播列表
  GetLiveList: function (data) {
    return fetch({
      url: '/livechannel/GetLiveList',
      method: 'get',
      params: data
    })
  },
  // 获取用户的直播列表
  GetLiveUserByLive: function (data) {
    return fetch({
      url: `/livechannel/GetLiveUserByLive/`+data,
      method: 'get',
      params: data
    })
  },
  // 获取点播频道
  getVideo: function (data) {
    return fetch({
      url: '/video/GetAll',
      method: 'post',
      params: data
    })
  },
  // 更新点播资源
  updateVideo: function (data) {
    return fetch({
      url: '/video/Update',
      method: 'post',
      params: data
    })
  },
  // 添加点播资源
  addVideo: function (data) {
    return fetch({
      url: '/video/',
      method: 'post',
      params: data
    })
  },
  // 删除点播资源
  deleteVideo: function (data) {
    return fetch({
      url: '/video/Delete',
      method: 'post',
      params: data
    })
  },
  // 删除多个点播
  deleteVideos: function (data) {
    return fetch({
      url: '/video/DeleteVideos',
      method: 'post',
      params: data
    })
  },
  // 点播资源上传取消
  VideoCancel: function (data) {
    return fetch({
      url: '/video/VideoCancel',
      method: 'post',
      params: data
    })
  },
  // 获取点播列表
  GetVideoList: function (data) {
    return fetch({
      url: '/video/GetVideoList',
      method: 'get',
      params: data
    })
  },
  // 获取用户点播资源
  GetVideoUserByVideo: function (data) {
    return fetch({
      url: `/video/GetVideoUserByVideo/`+data,
      method: 'get',
      params: data
    })
  },
  //  观看行为
  VideoWatch: function (data) {
    return fetch({
      url: '/video/VideoWatch',
      method: 'post',
      params: data
    })
  },
  // 更新观看历史
  watchhistory: function (data) {
    return fetch({
      url: '/watchhistory/',
      method: 'post',
      params: data
    })
  },
  // 获取观看历史
  GetWatchHistory: function (data) {
    return fetch({
      url: '/watchhistory/GetWatchHistory',
      method: 'get',
      params: data
    })
  },
  // 单位统计类
  StatisticsOrgs: function (data) {
    return fetch({
      url: '/statistics/StatisticsOrgs',
      method: 'get',
      params: data
    })
  },
  // 用户统计
  StatisticsUser: function (data) {
    return fetch({
      url: '/statistics/StatisticsUser',
      method: 'get',
      params: data
    })
  },
  // 点播统计
  StatisticsVideo: function (data) {
    return fetch({
      url: '/statistics/StatisticsVideo',
      method: 'get',
      params: data
    })
  },
  // 直播统计
  StatisticsLive: function (data) {
    return fetch({
      url: '/statistics/StatisticsLive',
      method: 'get',
      params: data
    })
  },
  // 存储统计
  StaticticsStore: function (data) {
    return fetch({
      url: '/statistics/StatisticsStore',
      method: 'get',
      params: data
    })
  },
  //正在执行的采购单
  getAssetsbuyDoing: function (data) {
    return fetch({
      url: '/assetsbuy/GetDoing',
      method: 'get',
      params: data
    })
  },
  // 已完成流转中采购单
  getAssetsbuyCompleted: function (data) {
    return fetch({
      url: '/assetsbuy/GetCompleted',
      method: 'get',
      params: data
    })
  },
  // 已归档采购单
  getAssetsbuyFinish: function (data) {
    return fetch({
      url: '/assetsbuy/GetFinish',
      method: 'get',
      params: data
    })
  },
  // 更新采购单
  updateAssetsbuy: function (data) {
    return fetch({
      url: '/assetsbuy/Update',
      method: 'post',
      params: data
    })
  },
  // 添加采购单
  addAssetsbuy: function (data) {
    return fetch({
      url: '/assetsbuy/',
      method: 'post',
      params: data
    })
  },
  // 删除采购单
  deleteAssetsbuy: function (data) {
    return fetch({
      url: '/assetsbuy/Delete',
      method: 'post',
      params: data
    })
  },
  // 上报采购单
  applyAssetsbuy: function (data) {
    return fetch({
      url: '/assetsbuy/Apply',
      method: 'post',
      params: data
    })
  },
}

export default apiList
